updating oE poke8
poke8
<built-in> procedure poke8(atom addr, object x)
stores one or more quad words, starting at a memory location.
Parameters:
- addr : an atom, the address at which to store
- x : an object, either a quad word or a non empty sequence of double words.
Errors:
Poking in memory you do not own may be blocked by the OS, and cause a machine exception. If you use the define safe these routines will catch these problems with a Euphoria error.
Comments:
There is no point in having poke8s or poke8u. For example, both +power(2,63) and -power(2,63) are stored as #F000000000000000. It is up to whoever reads the value to figure it out.
It is faster to write several quad words at once by poking a sequence of values, than it is to write one quad words at a time in a loop.
The 8-byte values to be stored can be negative or positive. You can read them back with either peek8s or peek8u. However, the results are unpredictable if you want to store values with a fractional part or a magnitude greater than power(2,64), even though Euphoria represents them all as atoms.
Example 1:
a = allocate(100) -- allocate 100 bytes in memory -- poke one 8-byte value at a time: poke8(a, 9712345) poke8(a+8, #FF00FF00) poke8(a+16, -12345) -- poke 3 8-byte values at once: poke8(a, {9712345, #FF00FF00, -12345})
See Also:
Using Data Double Words, peek4s, peek4u, poke, poke2, allocate, free, call
Not Categorized, Please Help
|